@extends('common')
@section('content')
<link rel="stylesheet" href="{{url('api/shade/css/theme.css')}}" media="all">
<script type="text/javascript" src="/api/img/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/api/img/ckeditor/ckfinder/ckfinder.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
	$('.theme-login').click(function(){
		$('.theme-popover-mask').fadeIn(100);
		$('.theme-popover').slideDown(200);
	})
	$('.theme-poptit .close').click(function(){
		$('.theme-popover-mask').fadeOut(100);
		$('.theme-popover').slideUp(200);
	})

})
</script>
<style type="text/css">
#ta tr{height:50px;font-size:20px;}
#demo{ margin:50px auto; width:540px; min-height:800px; background:#CF9}
</style>
<div width='520px'  style="margin-left:30%" >
<form method="post" action="" class="form-inline definewidth m20" enctype="multipart/form-data">
<p>
<input type="button" class='info' style='width:170px;height:40px;font-size:18px;Background-color:#1b3160;color:#ffffff' value="企业信息" >
<input class='base' type="button" style='width:170px;height:40px;font-size:18px color:#e8e9ee' value="基础信息" >
<input class='apt' type="button" style='width:170px;height:40px;font-size:18px color:#e8e9ee' value="企业资质" >
</p>
<div id='info'>
<table id="ta">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<tr>
	<td>公司名称:</td>
	<td><input type="text" name="com_name" value="{{$arr->com_name}}" placeholder="请输入公司名称" required></td>
</tr>
<tr>
	<td>企业LOGO:</td>
	<td><img src="{{url($arr->com_logo)}}" alt="" width=150 height=150 /></td>
	<input type="hidden" name="com_logo" value="{{$arr->com_logo}}">
</tr>
<tr>
    <td>更换LOGO:</td>
    <td><input type="file" name="file" style="border:0px"></td>
</tr>
<tr>
	<td>联系人:</td>
	<td><input type="text" name="com_contact" value="{{$arr->com_contact}}" pattern="[\u4e00-\u9fa5]{2,6}" placeholder="如:张三"></td>
</tr>
<tr>
	<td>联系电话:</td>
	<td><input type="text" name="com_phone" value="{{$arr->com_phone}}"  pattern="1[3,5,8]\d{9}" placeholder="请填写电话号码" required></td>
</tr>
<tr>
	<td>传真:</td>
	<td><input type="text" name="com_fax" value="{{$arr->com_fax}}" pattern="\d{1,12}" placeholder="请填写传真号" required></td>
</tr>
<tr>
	<td>企业简介:</td>
	<td></td>
</tr>
<tr>
	<td></td>
	<td><textarea name="com_introduce" id="empty" cols="50" rows="10" style='width:300px'>{{$arr->com_introduce}}</textarea></td>
</tr>
</table>


</div>
<div id='base'  >
<textarea name="com_basicnews" id="" cols="50" rows="10" style='width:500px'>{{$arr->com_basicnews}}</textarea>



</div>
<div id='apt'>
<?php 
$com_show=json_decode($arr->com_show);
$com_apt=json_decode($arr->com_apt);

?>
<h4>公司资质</h4>
<table>
<tr>
	<td>
	@foreach($com_apt as $v)
	<img src="{{url($v)}}" alt="" width=200;height=200px />
	@endforeach
	</td>
	
</tr>
<tr>
	
	
</tr>
</table> <hr />
<h4>公司展示</h4>
<table>
<tr>
	<td>
	@foreach($com_show as $vv)
	<img src="{{url($vv)}}" alt="" width=200;height=200px />
	@endforeach
	</td>
</tr>
<tr>
	<td><a class="btn btn-primary btn-large theme-login" href="javascript:;">上传图片</a></td>
	
</tr>
</table>



</div>
<p style="margin-top:30px"><input id='submit' class='apt' type="submit" style='width:100px;height:40px;font-size:18px color:#e8e9ee' value="保存" ></p>
</form>
</div>

<div class="theme-popover">
     <div class="theme-poptit">
          <a href="javascript:;" title="关闭" class="close">×</a>
          <h3>上传公司资质/图片</h3>
     </div>
    <div>

		<p id='img'><textarea id="editor1" name="editor1"></textarea></p>
		<p>
		  <select id='type' name="type">
			<option value="0" selected>公司资质
			<option value="1">公司图片
		  </select>
		  <input type="button" value="上传" id='button'>
		</p>
	
	</div>
          
   <script type="text/javascript">
   
  CKEDITOR.replace( 'editor1',
{
filebrowserBrowseUrl : '/api/img/ckeditor/ckfinder/ckfinder.html',
filebrowserImageBrowseUrl : '/api/img/ckeditor/ckfinder/ckfinder.html?Type=Images',
filebrowserFlashBrowseUrl : '/api/img/ckeditor/ckfinder/ckfinder.html?Type=Flash',
filebrowserUploadUrl : '/api/img/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl : '/api/img/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
filebrowserFlashUploadUrl : '/api/img/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
});
   </script>  


</div>

<input type="hidden" id='_token' name="_token" value="{{ csrf_token() }}">
<script type="text/javascript">


$(function(){


$('#button').click(function(){

var name=CKEDITOR.instances.editor1.getData()
var type=$('#type').val()
var _token=$('#_token').val()
	
$.ajax({
   type: "get",
   url: "/manager/comimg",
   data: "name="+name+"&type="+type+"&_token"+_token,
   success: function(msg){
     alert( msg );
   }
});


})




$('#base').hide();
$('#apt').hide()

$('.base').click(function(){
$('#base').show();
$('#info').hide();
$('#apt').hide();

$(this).attr('style','width:170px;height:40px;font-size:18px;Background-color:#1b3160;color:#ffffff');
$('.info').attr('style','width:170px;height:40px;font-size:18px color:#e8e9ee')
$('.apt').attr('style','width:170px;height:40px;font-size:18px color:#e8e9ee')
})

$('.apt').click(function(){
$('#base').hide();
$('#info').hide();
$('#apt').show();
$(this).attr('style','width:170px;height:40px;font-size:18px;Background-color:#1b3160;color:#ffffff');
$('.base').attr('style','width:170px;height:40px;font-size:18px color:#e8e9ee')
$('.info').attr('style','width:170px;height:40px;font-size:18px color:#e8e9ee')
})

$('.info').click(function(){
$('#base').hide();
$('#info').show();
$('#apt').hide();

$(this).attr('style','width:170px;height:40px;font-size:18px;Background-color:#1b3160;color:#ffffff');
$('.base').attr('style','width:170px;height:40px;font-size:18px color:#e8e9ee')
$('.apt').attr('style','width:170px;height:40px;font-size:18px color:#e8e9ee')
})

})

</script>



@stop
